/*
 * UartDrv.h
 *
 *  Created on: Apr 6, 2015
 *      Author: ma.xw
 */

#ifndef UARTDRV_H_
#define UARTDRV_H_

typedef void (*ON_RECEIVE_UART_MSG)(unsigned char* pbuf, unsigned long len);

void uart_init(unsigned int baud_rate);
void enable_send();
void enable_recv();

int uart_print_char(unsigned char c);
int uart_print(const char* pbuf);
int uart_printf(char*, ...);

void uart_register_on_receive_msg(ON_RECEIVE_UART_MSG fn);
void uart_on_recv_intr(unsigned char c);
void uart_on_send_done_intr();

#endif /* UARTDRV_H_ */
